from rest_framework import serializers

from apps.report.models import Report


class ReportSerializers(serializers.ModelSerializer):
    plan_name = serializers.CharField(source='plan.name', read_only=True, required=False)

    class Meta:
        model = Report
        fields = ('id', 'name', 'plan_name', 'plan', 'total', 'success', 'fail', 'report_path', 'add_time', 'edit_time')
